# -*- codeing = utf-8 -*-
# @Time : 2021/2/21 17:01
# @Atuthor: 朱朱
# @File: 024位运算符.py
# @Software: PyCharm

# 位运算,相对于二进制0,1,按相对位进行运算,然后取值
# 按位与&   按位或|  按位异或^  按位左移<<   按位右移>>  按位取反~
a = 23
b = 15
print(a & b)
print(a | b)
print(a ^ b)

x = 5
print(x << 3)  # a << n  ==> a * 2的n次方

y = 15
print(y >> 2)  # a >> n ==> a 除以 2的n次方